package 力扣._元辅音字符串计数1;

import java.util.HashSet;
import java.util.Set;

public class 暴力 {
    public int countOfSubstrings(String word, int k) {
        Set<Character> vowels = new HashSet<>();
        vowels.add('a');vowels.add('i');vowels.add('e');vowels.add('o');vowels.add('u');

        int n = word.length();
        int ans = 0;
        for(int i=0;i<n;i++){
            // 从当前i点开始
            Set<Character> set = new HashSet<>();
            int con = 0;
            for (int j = i; j < n; j++) {
                if(vowels.contains(word.charAt(j))){
                    set.add(word.charAt(j));
                }else
                    con++;

                if(set.size()==5&&con==k)
                    ans++;
            }

        }
        return ans;

    }
}
